﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Shop.Model;
using Shop.Framework.Keys;

namespace Shop.Framework.Page {
    public class ProductListPage:ViewPage<List<Product>> {
        public Category CurrentCategory { get; set; }
        public Designer CurrentDesigner { get; set; }
        public bool IsCategory { get; set; }
        public bool IsDesigner { get; set; }

        protected override void OnInit(EventArgs e) {
            try {

                CurrentCategory = ViewData[ShopKey.CurrentCategory] as Category;
                CurrentDesigner = ViewData[ShopKey.CurrentDesigner] as Designer;

                IsCategory = CurrentCategory != null;
                IsDesigner = CurrentDesigner != null;    

                base.OnInit(e);
            } catch (Exception ex) {
                throw ex;
            }
        }

    }
}
